
const str = 'hello'
const bigStr = 'hello world'
//string.includes() determines if a string can be found inside another one
const result = bigStr.includes(str)//true
const empty = ''
const resultForEmpty = bigStr.includes(empty)//true
console.log(result,resultForEmpty)
//str.repeat(x) concatenates x copies of str and returns it
console.log(str.repeat(2))//hellohello
console.log(str.repeat())//空字符串
//str.startsWith(searchString) determines whether str begins with searchString.
//第一个参数:寻找的字符串 第二个参数(可选):从哪个下标还是寻找 
//返回值：boolean
console.log(bigStr.startsWith(str))//true
console.log(bigStr.startsWith('ello',1))//true
//str.endsWith(searchString) determines whether str ends with searchString
//同startsWith类似 ,第二个参数:到哪个下标结束停止查找
console.log(bigStr.endsWith('ld'))//true
console.log(bigStr.endsWith('world',1))//false

